---
layout: page
title: 博文
background: '/img/bg-post.jpg'
search: true
---

{% for post in paginator.posts %}

  <article class="post-preview">
    <a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">
      <h2 class="post-title">{{ post.title }}</h2>
      {% if post.subtitle %}
      <h4 class="post-subtitle">{{ post.subtitle }}</h4>
      {% else %}
      <h4 class="post-subtitle">{{ post.excerpt | strip_html | truncatewords: 15 }}</h4>
      {% endif %}
    </a>
    <p class="post-meta"><!--Posted by
      {% if post.author %}
        {{ post.author }}
      {% else %}
        {{ site.author }}
      {% endif %}
      on --> {{ post.date | date: '%Y年%m月%d日' }}</p>
  </article>

  <hr>

{% endfor %}

<!-- Pager -->
{% if paginator.total_pages > 1 %}

  <div class="clearfix">

    {% if paginator.previous_page %}
      <a class="btn btn-primary float-left" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&larr;新<span class="d-none d-md-inline">博文</span></a>
    {% endif %}

    {% if paginator.next_page %}
      <a class="btn btn-primary float-right" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">旧<span class="d-none d-md-inline">博文</span> &rarr;</a>
    {% endif %}

  </div>

{% endif %}
